package org.walkerljl.commons.converter;

/**
 * CapacityConverter
 *
 * @author lijunlin
 */
public class CapacityConverter {

    public static Double byteToKb(Double b) {
        if (b == null || b <= 0d) {
            return 0d;
        }
        return b / 1024;
    }

    public static Double byteToMb(Double b) {
        if (b == null || b <= 0d) {
            return 0d;
        }
        return b / 1048576;
    }
}
